#include <bits/stdc++.h>

#define in read()
#define fi first
#define se second
#define pb push_back
#define rep(i, x, y) for(int i = (x); i <= (y); i++)
#define per(i, x, y) for(int i = (x); i >= (y); i--)

using namespace std;

typedef long long ll;
typedef double db;
typedef vector < int > vec;
typedef pair < int , int > pii;

int read() {
    int x = 0; bool f = 0; char ch = getchar(); while(!isdigit(ch)) f |= ch == '-',ch = getchar();
    while(isdigit(ch)) x = x * 10 + (ch ^ 48),ch = getchar(); return f ? -x : x;
}

const int N = 1e7 + 10;

int pri[N], pnum, f[N], p[N];
bool v[N];

inline void upd(int x, int v) {
	if(f[v] + 1 < f[x]) {
		p[x] = v; f[x] = f[v] + 1;
	}
}

void shai(int l) {
	f[1] = f[0] = 1; p[0] = 0; p[1] = 0;
	rep(i, 2, l) {
		if(!v[i]) pri[++pnum] = i;
		rep(j, 1, pnum) {
			if(pri[j] * i > l) break;
			v[pri[j] * i] = true;
			if(i % pri[j] == 0) break;
		}
	}
//	rep(i, 1, 100) cerr << pri[i] << " ";
	int lst = 0;
//	int cnt = 0;
//	dequeue < int > q;
	rep(i, 2, l) {
		if(!v[i]) f[i] = 1, lst = i, p[i] = 0;
		else {
			f[i] = 1e9;
			upd(i, i - 1);
			rep(j, 1, 70) if(i > pri[j]) upd(i, i - pri[j]);
			upd(i, i - lst);
		}
		//if(i <= 100000) cerr << f[i] << " " ;
//		if(f[i] >= 3) cerr << i << " ";
		assert(f[i] <= 3);
	} //cerr << cnt << endl;
}

vec pot;

void work(int x) {
	if(x == 0) return;
	pot.pb(x - p[x]);
	work(p[x]);
}

void solve() {
	int x = in;
	if(x == 0) {
		puts("1"); puts("0 = 0");
	} else {
		printf("%d\n", f[x]);
		pot.clear();
		work(x); sort(pot.begin(), pot.end());
		rep(i, 0, (int)pot.size() - 1) {
			if(i) printf(" + ");
			printf("%d", pot[i]);
		} printf(" = %d", x);
		puts("");
	}
}

int main() {
#ifndef ONLINE_JUDGE
    freopen("1.in","r",stdin);
#endif
    shai(10000000);
	int T = in; while(T--) solve();
}
